package com.ctrip.framework.apollo.demo.spring.javaConfigDemo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @ClassName DelayTaskProperties
 * @Description 延时任务配置
 * @Author chen.pian
 * @Date 2019/5/14 9:16
 **/
@Component
@ConfigurationProperties(prefix = "task.delay")
public class DelayTaskProperties {
    /**
     * 延时任务的redis队列最大长度
     */
    private int maxSize;
    /**
     * 每次加载DB延时任务的最大限制
     */
    private int limitSize;
    /**
     * 延时任务默认加载数据库的频率为10s,单位是ms
     */
    private int loadFrequency;

    /**
     * 延时任务默认加锁时间为2分钟,单位是s
     */
    private int loadLockTime;
    /**
     * 延时任务默认有10个核心线程消费
     */
    private int poolMinSize;
    /**
     * 延时任务默认最大有20个核心线程消费
     */
    private int poolMaxSize;
    /**
     * 延时任务默认非核心线程存活10s
     */
    private int poolMaxActive;
    /**
     * 延时任务默认处理的队列最大为5000
     */
    private int poolMaxQueueSize;
    /**
     * 开启延时任务消费
     */
    private boolean enable;

    public int getMaxSize() {
        return maxSize;
    }

    public void setMaxSize(int maxSize) {
        this.maxSize = maxSize;
    }

    public int getLimitSize() {
        return limitSize;
    }

    public void setLimitSize(int limitSize) {
        this.limitSize = limitSize;
    }

    public int getLoadFrequency() {
        return loadFrequency;
    }

    public void setLoadFrequency(int loadFrequency) {
        this.loadFrequency = loadFrequency;
    }

    public int getLoadLockTime() {
        return loadLockTime;
    }

    public void setLoadLockTime(int loadLockTime) {
        this.loadLockTime = loadLockTime;
    }

    public int getPoolMinSize() {
        return poolMinSize;
    }

    public void setPoolMinSize(int poolMinSize) {
        this.poolMinSize = poolMinSize;
    }

    public int getPoolMaxSize() {
        return poolMaxSize;
    }

    public void setPoolMaxSize(int poolMaxSize) {
        this.poolMaxSize = poolMaxSize;
    }

    public int getPoolMaxActive() {
        return poolMaxActive;
    }

    public void setPoolMaxActive(int poolMaxActive) {
        this.poolMaxActive = poolMaxActive;
    }

    public int getPoolMaxQueueSize() {
        return poolMaxQueueSize;
    }

    public void setPoolMaxQueueSize(int poolMaxQueueSize) {
        this.poolMaxQueueSize = poolMaxQueueSize;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }
}
